import mysql.connector
conn=mysql.connector.connect(user="root",password="password",database="members")

cursor=conn.cursor()
# cursor.execute("create table userInfo(\
#                 id varchar(20) PRIMARY KEY,\
#                     name varchar(20))")

cursor.execute("insert into userInfo(id,name) values(%s,%s) ",["001","李立宗"])
cursor.execute("insert into userInfo(id,name) values(%s,%s) ",["002","刘能"])
cursor.execute("insert into userInfo(id,name) values(%s,%s) ",["003","赵四"])
conn.commit()
cursor.close()
conn.close()
















# import mysql.connector
# conn = mysql.connector.connect(user='root', password='password', database='members')
# cursor = conn.cursor()
# cursor.execute('create table userInfo (\
#     ID varchar(20) primary key, \
#     name varchar(20))')

# cursor.execute('insert into userInfo (ID, name) values (%s, %s)', ['001', '李立宗'])
# cursor.execute('insert into userInfo (ID, name) values (%s, %s)', ['002', '刘能'])
# cursor.execute('insert into userInfo (ID, name) values (%s, %s)', ['003', '赵四'])

# conn.commit()
# cursor.close()
# conn.close()